<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'modify.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    

	<script type="text/javascript">
		
		function sendData() {
		
			//alert(window.opener.document.getElementById("test").value);
		
			//让当前页面提交
			document.forms[0].submit();
			//让当前窗口关闭
			window.self.close();
			//让父窗口的地址栏转向到指定位置
			window.opener.location.href="/WebDemo2/servlet/CartServlet?method=getCart";
			//父页面重新加载一遍，类似刷新
			//window.opener.location.reload();
		}
	
	</script>

  </head>
  
  <body>
    	<form action="servlet/CartServlet"  method="post">
    		
    		<input type="hidden" name="method" value="modifyCart" /> 
    		<!-- 获取修改产品的Id -->
    		<input type="hidden"  name="pid" value="${param.pid }">
    		
    		<fieldset>
    			<legend>修改商品数量</legend>
    			<input type="text"  name="count" >
    			<button onclick="sendData()">Update</button>
    		</fieldset>
    	</form>
  </body>
</html>
